package com.maomao.utils;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by admin on 2018/3/23.
 */
public class StringUtil {
    public static List<String> getStrList(String inputString, int length,
                                          int size) {
        List<String> list = new ArrayList<String>();
        for (int index = 0; index < size; index++) {
            String childStr = substring(inputString, index * length,
                    (index + 1) * length);
            list.add(childStr);
        }
        return list;
    }
    public static String substring(String str, int f, int t) {
        if (f > str.length())
            return null;
        if (t > str.length()) {
            return str.substring(f, str.length());
        } else {
            return str.substring(f, t);
        }
    }
    public static List<String> getStrList(String inputString, int length) {
        int size = inputString.length() / length;
        if (inputString.length() % length != 0) {
            size += 1;
        }
        return getStrList(inputString, length, size);
    }
    public static void main(String[] args){
        String string="o";
        System.out.println(string.hashCode());
        System.out.println(string);
        int[] a = {1,2};
    }
}
